The present invention relates to reproduction of images and in particular to digital scanning and character recognition systems.
A document image is a visual representation of a two-dimensional printed page. A document image can be created by optical scanning or raster-digitizing the document object. Common devices used to create document images include photocopiers, facsimile machines and digital scanners. These document imaging devices are of great assistance in today""s business world for the efficient assembly and dissemination of printed information.
In documents having multiple pages or images, however, there exists a probability that an individual page, or image, may be in an improper orientation relative to the remaining images and text within the document. For example, one page of a multiple page document may be upside down when compared to the remainder of the document. This occurrence inconveniences the reader of the assembled document. In addition, the inclusion of an improperly oriented image may be negatively interpreted as the sloppiness and unprofessionalism of the document producer.
At present, the predominant way to detect an image in an improper orientation is by visual inspection of the document prior to assembly or reproduction. This process is labor intensive and inefficient. Furthermore, this process is also subject to human error, or the limitations of the inspector to recognize the proper orientation. For example, the document may be in a foreign language other than that known to the inspector. For this reason, the inspector may have difficulty detecting a page in an improper orientation.
The present invention provides an apparatus and method for detecting incorrect orientation of pages or text within a document during document assembly storage and/or reproduction. The improperly oriented image can then be reproduced in the correct orientation within the completed document by digital manipulation of the image.
According to one aspect of the present invention, the image to be reproduced is first scanned to form a digital representation of the document. The document is then analyzed at the pixel level to identify rectangles that bound text words, noise and image data. In a selection of rectangles, identified as containing words, the number of black pixels on each scan line within the rectangle are counted. The pixel count can be used to determine the number of ascenders and descenders within the rectangle and this data can be analyzed to determine the proper orientation of the document. For example, within the English language, words are comprised primarily of ascenders. The mean, variance and/or skew for a sample set of the document pixel data can be compared to normalized mean, variance and/or skew data for documents in a known orientation to ascertain the orientation of the current document image.
According to another aspect of the present invention, the classification of the document image into word, image and noise data permits the document orientation to be ascertained easily despite the presence of image data.